import xlwings as xw

app = xw.App(visible=True, add_book=False)

wb_new = app.books.open('文件名称')
wb_back = app.books.open('文件名称')

for row in wb_back.sheets[0].range('A1').expand():
    for cell in row:
        # new_cell = wb_new.sheets[0].range(cell.row, cell.column)
        new_cell = wb_new.sheets[0].range(cell.address)
        if cell.value != new_cell.value:
            print(f"{cell.address} 已被修改")
            cell.color = new_cell.color = (255, 0, 0)  # 设置颜色为红色

wb_back.save()
wb_back.close()
wb_new.save()
wb_new.close()
app.quit()